﻿@using Model.WXshopBuiness
@using Model.Util.DTO
@using Model.Util
@using Xproject.Util
@using Model.ZXBuiness
@{
    Layout = "~/Views/Shared/_JSlayout.cshtml";
    string Domain = CommonHelper.GetAppSettings("Domin");  
}
@model ZXProductRate

<div class="gray-bg">
    <div class="  animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">

                    <div class="ibox-content">
                        <form class="form-horizontal m-t" id="formProductpromotion" action="~/WXProduct/EditProductRate" method="post">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">第一级提成比例：</label>
                                <div class="col-sm-8">
                                    <input id="P1Rate" name="P1Rate" class="form-control" type="number" step="0.01" required maxlength="20" value="@(Model!=null?Model.P1Rate:0.00M)">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">第二级提成比例：</label>
                                <div class="col-sm-8">
                                    <input id="P2Rate" name="P2Rate" class="form-control" type="number" step="0.01" required maxlength="20" value="@(Model!=null?Model.P2Rate:0.00M)">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">第三级提成比例：</label>
                                <div class="col-sm-8">
                                    <input id="P3Rate" name="P3Rate" class="form-control" type="number" step="0.01" required maxlength="20" value="@(Model!=null?Model.P3Rate:0.00M)">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">第四级提成比例（暂时不允许）</label>
                                <div class="col-sm-8">
                                    <input id="P4Rate" name="P4Rate" class="form-control" readonly="readonly" type="number" step="0.01" required maxlength="20" value="@(Model!=null?Model.P4Rate:0.00M)">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">第五级提成比例（暂时不允许）</label>
                                <div class="col-sm-8">
                                    <input id="P5Rate" name="P5Rate" class="form-control"  readonly="readonly" type="number" step="0.01" required maxlength="20" value="@(Model!=null?Model.P5Rate:0.00M)">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">第六级提成比例（暂时不允许）</label>
                                <div class="col-sm-8">
                                    <input id="P6Rate" name="P6Rate" class="form-control" readonly="readonly" type="number" step="0.01" required maxlength="20" value="@(Model!=null?Model.P6Rate:0.00M)">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">第七级提成比例（暂时不允许）</label>
                                <div class="col-sm-8">
                                    <input id="P7Rate" name="P7Rate" class="form-control" readonly="readonly" type="number" step="0.01" required maxlength="20" value="@(Model!=null?Model.P7Rate:0.00M)">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">第八级提成比例（暂时不允许）</label>
                                <div class="col-sm-8">
                                    <input id="P8Rate" name="P8Rate" class="form-control" readonly="readonly" type="number" step="0.01" required maxlength="20" value="@(Model!=null?Model.P8Rate:0.00M)">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">第九级提成比例（暂时不允许）</label>
                                <div class="col-sm-8">
                                    <input id="P9Rate" name="P9Rate" class="form-control" readonly="readonly" type="number" step="0.01" required maxlength="20" value="@(Model!=null?Model.P9Rate:0.00M)">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-8 col-sm-offset-3">
                                    <input name="ProductId" value="@ViewBag.ProductId" type="hidden" />
                                    <input name="Product_ZX_Rate_Id" value="@Model.Product_ZX_Rate_Id" type="hidden" />
                                    <button class="btn btn-primary" type="submit">提交</button>
                                </div>
                            </div>



                        </form>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var optionsNew = {
            beforeSubmit: function () {
                //layer.open({ type: 2, time: 2 });
                layer.load(1, { shade: [0.1, '#000'], time: 2000 });
            },
            success: function (data) {
                if (data.Success == true) {
                    layer.alert('编辑成功', { icon: 1, skin: 'layer-ext-moon', time: 2000 });
                } else {
                    layer.alert(data.Data, { icon: 1, skin: 'layer-ext-moon', time: 2000 });
                }
            },
            error: function () {
                alert(JSON.stringify(data));
            },
            type: "post",
            clearForm: false,
            timeout: 100000
        };

        $("#formProductpromotion").submit(function () {
            $("#formProductpromotion").ajaxSubmit(optionsNew);// type="button"
            return false;
        });
    });


</script>